﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.COM;

namespace MINERP.DAL.CommonDAL
{
    /// <summary>
    /// phj
    /// 2009-7-31
    /// 对photoInfo表操作的公共数据访问类
    /// </summary>
    public class PhotoInfoDAL:DALBase
    {
        public static photoInfo GetOneById(int pid)
        {
            return DataEntites.photoInfo.Where(pi => pi.photoId == pid).FirstOrDefault();
        }

        /// <summary>
        /// 得到正在生产中分配给打印机某种状态的照片集合
        /// </summary>
        /// <param name="status"></param>
        /// <returns></returns>
        public static List<photoInfo> GetPhotosByPinterAndStatus(PhotoStatus status,int printerId)
        {
            int intstatus=(int)status;
            int intOrderStatus=(int)OrderInfoStatus.Doing;
            return DataEntites.photoInfo.Where(pi => pi.status == intstatus && pi.orderInfo.status == intOrderStatus && pi.printerId == printerId).ToList();
        }


    }
}
